<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Lyric</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="RhythmCat Music Player Development Reference Manual">
<link rel="up" href="ch01.html" title="Player Backend">
<link rel="prev" href="RCPlayer.html" title="Player Object">
<link rel="next" href="RhythmCat-Asynchronous-Message-Queue.html" title="Asynchronous Message Queue">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="RCPlayer.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">RhythmCat Music Player Development Reference Manual</th>
<td><a accesskey="n" href="RhythmCat-Asynchronous-Message-Queue.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#RhythmCat-Lyric.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#RhythmCat-Lyric.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="Lyric">
<a name="RhythmCat-Lyric"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="RhythmCat-Lyric.top_of_page"></a>Lyric</span></h2>
<p>Lyric — Process lyric data.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="RhythmCat-Lyric.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;lyric.h&gt;

                    <a class="link" href="RhythmCat-Lyric.html#RCLyricData" title="RCLyricData">RCLyricData</a>;
<span class="returnvalue">void</span>                <a class="link" href="RhythmCat-Lyric.html#rc-lrc-init" title="rc_lrc_init ()">rc_lrc_init</a>                         ();
<span class="returnvalue">void</span>                <a class="link" href="RhythmCat-Lyric.html#rc-lrc-exit" title="rc_lrc_exit ()">rc_lrc_exit</a>                         ();
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="RhythmCat-Lyric.html#rc-lrc-read-from-file" title="rc_lrc_read_from_file ()">rc_lrc_read_from_file</a>               (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="RhythmCat-Lyric.html#rc-lrc-clean-data" title="rc_lrc_clean_data ()">rc_lrc_clean_data</a>                   ();
const <a class="link" href="RhythmCat-Lyric.html#RCLyricData" title="RCLyricData"><span class="returnvalue">RCLyricData</span></a> ** <a class="link" href="RhythmCat-Lyric.html#rc-lrc-get-lrc-data" title="rc_lrc_get_lrc_data ()">rc_lrc_get_lrc_data</a>                ();
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a>               <a class="link" href="RhythmCat-Lyric.html#rc-lrc-get-lrc-length" title="rc_lrc_get_lrc_length ()">rc_lrc_get_lrc_length</a>               ();
const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="RhythmCat-Lyric.html#rc-lrc-get-text-data" title="rc_lrc_get_text_data ()">rc_lrc_get_text_data</a>                ();
const <a class="link" href="RhythmCat-Lyric.html#RCLyricData" title="RCLyricData"><span class="returnvalue">RCLyricData</span></a> * <a class="link" href="RhythmCat-Lyric.html#rc-lrc-get-line-by-time" title="rc_lrc_get_line_by_time ()">rc_lrc_get_line_by_time</a>             (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> time</code></em>);
const <a class="link" href="RhythmCat-Lyric.html#RCLyricData" title="RCLyricData"><span class="returnvalue">RCLyricData</span></a> * <a class="link" href="RhythmCat-Lyric.html#rc-lrc-get-line-now" title="rc_lrc_get_line_now ()">rc_lrc_get_line_now</a>                 ();
</pre>
</div>
<div class="refsect1" title="Description">
<a name="RhythmCat-Lyric.description"></a><h2>Description</h2>
<p>
Process lyric texts, like reading lyric from LRC file, etc.
</p>
</div>
<div class="refsect1" title="Details">
<a name="RhythmCat-Lyric.details"></a><h2>Details</h2>
<div class="refsect2" title="RCLyricData">
<a name="RCLyricData"></a><h3>RCLyricData</h3>
<pre class="programlisting">typedef struct {
    gint64 time;
    gint64 length;
    guint index;
    gchar *text;
} RCLyricData;
</pre>
<p>
Custom struct type to store the data of lyrics.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> <em class="structfield"><code><a name="RCLyricData.time"></a>time</code></em>;</span></p></td>
<td>the start time of the lyric text
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> <em class="structfield"><code><a name="RCLyricData.length"></a>length</code></em>;</span></p></td>
<td>the time length of the lyric text
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="RCLyricData.index"></a>index</code></em>;</span></p></td>
<td>the line index number of the lyric text
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="RCLyricData.text"></a>text</code></em>;</span></p></td>
<td>the lyric text
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_lrc_init ()">
<a name="rc-lrc-init"></a><h3>rc_lrc_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                rc_lrc_init                         ();</pre>
<p>
Initialize the lyric watch timer.
</p>
</div>
<hr>
<div class="refsect2" title="rc_lrc_exit ()">
<a name="rc-lrc-exit"></a><h3>rc_lrc_exit ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                rc_lrc_exit                         ();</pre>
<p>
Remove the lyric watch timer.
</p>
</div>
<hr>
<div class="refsect2" title="rc_lrc_read_from_file ()">
<a name="rc-lrc-read-from-file"></a><h3>rc_lrc_read_from_file ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            rc_lrc_read_from_file               (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>);</pre>
<p>
Read lyric data from given file.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td>the lyric file
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Whether the file is read successfully.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_lrc_clean_data ()">
<a name="rc-lrc-clean-data"></a><h3>rc_lrc_clean_data ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                rc_lrc_clean_data                   ();</pre>
<p>
Clean the read lyric data from the player.
</p>
</div>
<hr>
<div class="refsect2" title="rc_lrc_get_lrc_data ()">
<a name="rc-lrc-get-lrc-data"></a><h3>rc_lrc_get_lrc_data ()</h3>
<pre class="programlisting">const <a class="link" href="RhythmCat-Lyric.html#RCLyricData" title="RCLyricData"><span class="returnvalue">RCLyricData</span></a> ** rc_lrc_get_lrc_data                ();</pre>
<p>
Return the processed lyric array in the player.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The processed lyric array in the player, the data is stored
in an array, NULL if there is no lyric data.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_lrc_get_lrc_length ()">
<a name="rc-lrc-get-lrc-length"></a><h3>rc_lrc_get_lrc_length ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a>               rc_lrc_get_lrc_length               ();</pre>
<p>
Return the length of the lyric array.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The length of the lyric array.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_lrc_get_text_data ()">
<a name="rc-lrc-get-text-data"></a><h3>rc_lrc_get_text_data ()</h3>
<pre class="programlisting">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       rc_lrc_get_text_data                ();</pre>
<p>
Return the original lyric text in the player.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The original lyric text in the player, NULL if there is no
lyric text.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_lrc_get_line_by_time ()">
<a name="rc-lrc-get-line-by-time"></a><h3>rc_lrc_get_line_by_time ()</h3>
<pre class="programlisting">const <a class="link" href="RhythmCat-Lyric.html#RCLyricData" title="RCLyricData"><span class="returnvalue">RCLyricData</span></a> * rc_lrc_get_line_by_time             (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> time</code></em>);</pre>
<p>
Return the lyric line data by given time.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>time</code></em> :</span></p></td>
<td>the time in nanosecond
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The lyric line data by given time, NULL if not found.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_lrc_get_line_now ()">
<a name="rc-lrc-get-line-now"></a><h3>rc_lrc_get_line_now ()</h3>
<pre class="programlisting">const <a class="link" href="RhythmCat-Lyric.html#RCLyricData" title="RCLyricData"><span class="returnvalue">RCLyricData</span></a> * rc_lrc_get_line_now                 ();</pre>
<p>
Return the lyric line data while the player is playing.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The lyric line data the player is playing.
</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>